package com.cx.factory;

public interface IShapeFactory {
    /**
     * 创建对象方法
     * @return
     */
    Shape createBean();
}
class TriangleFactory implements IShapeFactory{
    @Override
    public Shape createBean() {
        return new Triangle();
    }
}

class SquareFactory implements IShapeFactory{
    @Override
    public Shape createBean() {
        return new Square();
    }
}
